﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccessLayer.DAL;
namespace BestBuy.UserViews
{
    public partial class UserLandingPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id = UserDAL.GetUserIDByUsername(HttpContext.Current.User.Identity.Name);
                LoadAuctions(id);
            }
        }
        private void LoadAuctions(int id)
        {
            gvAuctions.DataSource = AuctionDAL.GetAllOpenAuctionIsUser(id);
            gvAuctions.DataBind();
            gvEndAuctions.DataSource = AuctionDAL.GetAllEndAuctionIsUser(id);
            gvEndAuctions.DataBind();
        }

    }
}